<?php
/**
 * 关于我们控制器
 * @author 王涛
 * @DataTime 2018-08-02T08:46:15+0800
 */
namespace app\api\controller;
use app\api\model\AboutModel;
use think\Request;

class About extends Base{
    public function index()
    {
        $about = new AboutModel;
        $data = $about->aboutInfo();
        return apiResponse(200,"查询成功",$data ?: '');
    }
    /**
     * 修改 编辑 关于我们
     * @author 王涛
     * @DataTime 2018-08-02T11:52:09+0800
     * @return   [type]                   [description]
     */
    public function editAbout(Request $request){
        $cash = new AboutModel();
        $addarray = $request->post();
        $check = $this->validate($addarray,"AboutValidate");
        if($check !== true){
            return apiResponse(201,$check,"");
        }
        $addarray["utime"]=time();
        $reslt = $cash ->editAbout($addarray);
        if($reslt){
            return apiResponse(200,"关于我们编辑成功","");
        }else{
            return apiResponse(201,"关于我们编辑失败","");
        }
    }
}